// $ANTLR 3.3 Nov 30, 2010 12:50:56 /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g 2011-05-24 09:27:45

    package lang4j.parser.generated;
    import org.apache.commons.lang.math.NumberUtils;
    import java.util.List;
    import java.util.LinkedList;
    import org.apache.commons.lang.StringEscapeUtils;
    import lang4j.parser.IdentifierMap;
    import lang4j.parser.Position;
    import lang4j.parser.ParsedEntity;



import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class Lang4jParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "MULTI_LINE_STRING", "IDENT", "STRING_LITERAL", "CHAR_LITERAL", "TRUE", "FALSE", "NUM_LONG", "NUM_FLOAT", "NUM_INT", "NUM_DOUBLE", "DOT", "NEWLINE", "WS", "ESCAPE_SEQUENCE", "UNICODE_ESCAPE", "OCTAL_ESCAPE", "HEX_DIGIT", "LINE_COMMENT", "ML_COMMENT", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "Exponent", "FloatTypeSuffix", "IntegerTypeSuffix", "EXPONENT", "FLOAT_SUFFIX", "'grammarName'", "':'", "';'", "'package'", "'list'", "'('", "')'", "'*'", "'^'", "'REFERENCE'", "'enum'", "'|'", "'interface'", "'key'", "'class'", "'['", "']'", "'CHAR_LITERAL'", "'LITERAL'", "'MULTI_LINE_LITERAL'", "'INT_LITERAL'", "'IDENTIFIER'", "'DOUBLE_LITERAL'", "'BOOLEAN_LITERAL'"
    };
    public static final int EOF=-1;
    public static final int T__31=31;
    public static final int T__32=32;
    public static final int T__33=33;
    public static final int T__34=34;
    public static final int T__35=35;
    public static final int T__36=36;
    public static final int T__37=37;
    public static final int T__38=38;
    public static final int T__39=39;
    public static final int T__40=40;
    public static final int T__41=41;
    public static final int T__42=42;
    public static final int T__43=43;
    public static final int T__44=44;
    public static final int T__45=45;
    public static final int T__46=46;
    public static final int T__47=47;
    public static final int T__48=48;
    public static final int T__49=49;
    public static final int T__50=50;
    public static final int T__51=51;
    public static final int T__52=52;
    public static final int T__53=53;
    public static final int T__54=54;
    public static final int MULTI_LINE_STRING=4;
    public static final int IDENT=5;
    public static final int STRING_LITERAL=6;
    public static final int CHAR_LITERAL=7;
    public static final int TRUE=8;
    public static final int FALSE=9;
    public static final int NUM_LONG=10;
    public static final int NUM_FLOAT=11;
    public static final int NUM_INT=12;
    public static final int NUM_DOUBLE=13;
    public static final int DOT=14;
    public static final int NEWLINE=15;
    public static final int WS=16;
    public static final int ESCAPE_SEQUENCE=17;
    public static final int UNICODE_ESCAPE=18;
    public static final int OCTAL_ESCAPE=19;
    public static final int HEX_DIGIT=20;
    public static final int LINE_COMMENT=21;
    public static final int ML_COMMENT=22;
    public static final int HEX_LITERAL=23;
    public static final int OCTAL_LITERAL=24;
    public static final int DECIMAL_LITERAL=25;
    public static final int Exponent=26;
    public static final int FloatTypeSuffix=27;
    public static final int IntegerTypeSuffix=28;
    public static final int EXPONENT=29;
    public static final int FLOAT_SUFFIX=30;

    // delegates
    // delegators


        public Lang4jParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public Lang4jParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
            this.state.ruleMemo = new HashMap[66+1];
             
             
        }
        

    public String[] getTokenNames() { return Lang4jParser.tokenNames; }
    public String getGrammarFileName() { return "/Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g"; }


        private String tokenInfo(Token token){
            return "Line"+ token.getLine()+":"+token.getCharPositionInLine();
        }
        public IdentifierMap identifierMap=new IdentifierMap();

        public IdentifierMap getIdentifierMap(){
            return identifierMap;
        }



    // $ANTLR start "productionList"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:40:1: productionList returns [java.util.List list] : (listElement= production )* ;
    public final java.util.List productionList() throws RecognitionException {
        java.util.List list = null;
        int productionList_StartIndex = input.index();
        Production listElement = null;



               list=new java.util.ArrayList();
           
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return list; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:44:4: ( (listElement= production )* )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:44:6: (listElement= production )*
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:44:6: (listElement= production )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==35||LA1_0==41||LA1_0==43||LA1_0==45) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:45:8: listElement= production
            	    {
            	    pushFollow(FOLLOW_production_in_productionList70);
            	    listElement=production();

            	    state._fsp--;
            	    if (state.failed) return list;
            	    if ( state.backtracking==0 ) {

            	                     list.add(listElement);
            	                 
            	    }

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 1, productionList_StartIndex); }
        }
        return list;
    }
    // $ANTLR end "productionList"


    // $ANTLR start "lang4jGrammar"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:51:1: lang4jGrammar returns [Lang4jGrammar lang4jGrammar] : (commentToken= MULTI_LINE_STRING )? 'grammarName' ':' nameToken= IDENT ';' 'package' ':' packageNameToken= STRING_LITERAL ';' tempProductions= productionList ;
    public final Lang4jGrammar lang4jGrammar() throws RecognitionException {
        Lang4jGrammar lang4jGrammar = null;
        int lang4jGrammar_StartIndex = input.index();
        Token commentToken=null;
        Token nameToken=null;
        Token packageNameToken=null;
        java.util.List tempProductions = null;



                lang4jGrammar = new Lang4jGrammar();
                lang4jGrammar.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return lang4jGrammar; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:56:5: ( (commentToken= MULTI_LINE_STRING )? 'grammarName' ':' nameToken= IDENT ';' 'package' ':' packageNameToken= STRING_LITERAL ';' tempProductions= productionList )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:57:5: (commentToken= MULTI_LINE_STRING )? 'grammarName' ':' nameToken= IDENT ';' 'package' ':' packageNameToken= STRING_LITERAL ';' tempProductions= productionList
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:57:5: (commentToken= MULTI_LINE_STRING )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==MULTI_LINE_STRING) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:58:5: commentToken= MULTI_LINE_STRING
                    {
                    commentToken=(Token)match(input,MULTI_LINE_STRING,FOLLOW_MULTI_LINE_STRING_in_lang4jGrammar126); if (state.failed) return lang4jGrammar;
                    if ( state.backtracking==0 ) {
                      lang4jGrammar.setComment(StringEscapeUtils.unescapeJava(commentToken.getText().substring(3,commentToken.getText().length()-3)));
                    }

                    }
                    break;

            }

            match(input,31,FOLLOW_31_in_lang4jGrammar146); if (state.failed) return lang4jGrammar;
            match(input,32,FOLLOW_32_in_lang4jGrammar148); if (state.failed) return lang4jGrammar;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_lang4jGrammar158); if (state.failed) return lang4jGrammar;
            if ( state.backtracking==0 ) {
              lang4jGrammar.setName(nameToken.getText());
            }
            match(input,33,FOLLOW_33_in_lang4jGrammar171); if (state.failed) return lang4jGrammar;
            match(input,34,FOLLOW_34_in_lang4jGrammar173); if (state.failed) return lang4jGrammar;
            match(input,32,FOLLOW_32_in_lang4jGrammar175); if (state.failed) return lang4jGrammar;
            packageNameToken=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_lang4jGrammar184); if (state.failed) return lang4jGrammar;
            if ( state.backtracking==0 ) {
              lang4jGrammar.setPackageName(StringEscapeUtils.unescapeJava(packageNameToken.getText().substring(1,packageNameToken.getText().length()-1)));
            }
            match(input,33,FOLLOW_33_in_lang4jGrammar197); if (state.failed) return lang4jGrammar;
            pushFollow(FOLLOW_productionList_in_lang4jGrammar207);
            tempProductions=productionList();

            state._fsp--;
            if (state.failed) return lang4jGrammar;
            if ( state.backtracking==0 ) {
              lang4jGrammar.setProductions(tempProductions);
            }
            if ( state.backtracking==0 ) {
              lang4jGrammar.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 2, lang4jGrammar_StartIndex); }
        }
        return lang4jGrammar;
    }
    // $ANTLR end "lang4jGrammar"


    // $ANTLR start "production"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:70:1: production returns [Production value] : (enumProductionLabel= enumProduction | typeProductionLabel= typeProduction | listProductionLabel= listProduction ) ;
    public final Production production() throws RecognitionException {
        Production value = null;
        int production_StartIndex = input.index();
        EnumProduction enumProductionLabel = null;

        TypeProduction typeProductionLabel = null;

        ListProduction listProductionLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:72:5: ( (enumProductionLabel= enumProduction | typeProductionLabel= typeProduction | listProductionLabel= listProduction ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:72:6: (enumProductionLabel= enumProduction | typeProductionLabel= typeProduction | listProductionLabel= listProduction )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:72:6: (enumProductionLabel= enumProduction | typeProductionLabel= typeProduction | listProductionLabel= listProduction )
            int alt3=3;
            switch ( input.LA(1) ) {
            case 41:
                {
                alt3=1;
                }
                break;
            case 43:
            case 45:
                {
                alt3=2;
                }
                break;
            case 35:
                {
                alt3=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 3, 0, input);

                throw nvae;
            }

            switch (alt3) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:72:7: enumProductionLabel= enumProduction
                    {
                    pushFollow(FOLLOW_enumProduction_in_production251);
                    enumProductionLabel=enumProduction();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = enumProductionLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:74:6: typeProductionLabel= typeProduction
                    {
                    pushFollow(FOLLOW_typeProduction_in_production263);
                    typeProductionLabel=typeProduction();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = typeProductionLabel;
                    }

                    }
                    break;
                case 3 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:76:6: listProductionLabel= listProduction
                    {
                    pushFollow(FOLLOW_listProduction_in_production275);
                    listProductionLabel=listProduction();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = listProductionLabel;
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {
               identifierMap.addInstance("production",value.getName(),value);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 3, production_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "production"


    // $ANTLR start "typeProduction"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:81:1: typeProduction returns [TypeProduction value] : (interfaceProductionLabel= interfaceProduction | constructorProductionLabel= constructorProduction ) ;
    public final TypeProduction typeProduction() throws RecognitionException {
        TypeProduction value = null;
        int typeProduction_StartIndex = input.index();
        InterfaceProduction interfaceProductionLabel = null;

        ConstructorProduction constructorProductionLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:83:5: ( (interfaceProductionLabel= interfaceProduction | constructorProductionLabel= constructorProduction ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:83:6: (interfaceProductionLabel= interfaceProduction | constructorProductionLabel= constructorProduction )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:83:6: (interfaceProductionLabel= interfaceProduction | constructorProductionLabel= constructorProduction )
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==43) ) {
                alt4=1;
            }
            else if ( (LA4_0==45) ) {
                alt4=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;
            }
            switch (alt4) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:83:7: interfaceProductionLabel= interfaceProduction
                    {
                    pushFollow(FOLLOW_interfaceProduction_in_typeProduction302);
                    interfaceProductionLabel=interfaceProduction();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = interfaceProductionLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:85:6: constructorProductionLabel= constructorProduction
                    {
                    pushFollow(FOLLOW_constructorProduction_in_typeProduction314);
                    constructorProductionLabel=constructorProduction();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = constructorProductionLabel;
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {
               identifierMap.addInstance("typeProduction",value.getName(),value);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 4, typeProduction_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "typeProduction"


    // $ANTLR start "listProduction"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:90:1: listProduction returns [ListProduction value] : (listProductionStarLabel= listProductionStar | listProductionPowLabel= listProductionPow ) ;
    public final ListProduction listProduction() throws RecognitionException {
        ListProduction value = null;
        int listProduction_StartIndex = input.index();
        ListProductionStar listProductionStarLabel = null;

        ListProductionPow listProductionPowLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:91:5: ( (listProductionStarLabel= listProductionStar | listProductionPowLabel= listProductionPow ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:91:6: (listProductionStarLabel= listProductionStar | listProductionPowLabel= listProductionPow )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:91:6: (listProductionStarLabel= listProductionStar | listProductionPowLabel= listProductionPow )
            int alt5=2;
            alt5 = dfa5.predict(input);
            switch (alt5) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:91:7: listProductionStarLabel= listProductionStar
                    {
                    pushFollow(FOLLOW_listProductionStar_in_listProduction337);
                    listProductionStarLabel=listProductionStar();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = listProductionStarLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:93:6: listProductionPowLabel= listProductionPow
                    {
                    pushFollow(FOLLOW_listProductionPow_in_listProduction349);
                    listProductionPowLabel=listProductionPow();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = listProductionPowLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 5, listProduction_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "listProduction"


    // $ANTLR start "listProductionStar"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:98:1: listProductionStar returns [ListProductionStar listProductionStar] : 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '*' ';' ;
    public final ListProductionStar listProductionStar() throws RecognitionException {
        ListProductionStar listProductionStar = null;
        int listProductionStar_StartIndex = input.index();
        Token nameToken=null;
        ListElementType tempType = null;



                listProductionStar = new ListProductionStar();
                listProductionStar.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return listProductionStar; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:103:5: ( 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '*' ';' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:104:1: 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '*' ';'
            {
            match(input,35,FOLLOW_35_in_listProductionStar378); if (state.failed) return listProductionStar;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_listProductionStar388); if (state.failed) return listProductionStar;
            if ( state.backtracking==0 ) {
              listProductionStar.setName(nameToken.getText());
            }
            match(input,32,FOLLOW_32_in_listProductionStar401); if (state.failed) return listProductionStar;
            match(input,36,FOLLOW_36_in_listProductionStar403); if (state.failed) return listProductionStar;
            pushFollow(FOLLOW_listElementType_in_listProductionStar413);
            tempType=listElementType();

            state._fsp--;
            if (state.failed) return listProductionStar;
            if ( state.backtracking==0 ) {
              listProductionStar.setType(tempType);
            }
            match(input,37,FOLLOW_37_in_listProductionStar426); if (state.failed) return listProductionStar;
            match(input,38,FOLLOW_38_in_listProductionStar428); if (state.failed) return listProductionStar;
            match(input,33,FOLLOW_33_in_listProductionStar430); if (state.failed) return listProductionStar;
            if ( state.backtracking==0 ) {
              listProductionStar.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 6, listProductionStar_StartIndex); }
        }
        return listProductionStar;
    }
    // $ANTLR end "listProductionStar"


    // $ANTLR start "listProductionPow"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:111:1: listProductionPow returns [ListProductionPow listProductionPow] : 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '^' '(' tempLit= terminal ')' ';' ;
    public final ListProductionPow listProductionPow() throws RecognitionException {
        ListProductionPow listProductionPow = null;
        int listProductionPow_StartIndex = input.index();
        Token nameToken=null;
        ListElementType tempType = null;

        Terminal tempLit = null;



                listProductionPow = new ListProductionPow();
                listProductionPow.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return listProductionPow; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:116:5: ( 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '^' '(' tempLit= terminal ')' ';' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:117:1: 'list' nameToken= IDENT ':' '(' tempType= listElementType ')' '^' '(' tempLit= terminal ')' ';'
            {
            match(input,35,FOLLOW_35_in_listProductionPow465); if (state.failed) return listProductionPow;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_listProductionPow475); if (state.failed) return listProductionPow;
            if ( state.backtracking==0 ) {
              listProductionPow.setName(nameToken.getText());
            }
            match(input,32,FOLLOW_32_in_listProductionPow488); if (state.failed) return listProductionPow;
            match(input,36,FOLLOW_36_in_listProductionPow490); if (state.failed) return listProductionPow;
            pushFollow(FOLLOW_listElementType_in_listProductionPow500);
            tempType=listElementType();

            state._fsp--;
            if (state.failed) return listProductionPow;
            if ( state.backtracking==0 ) {
              listProductionPow.setType(tempType);
            }
            match(input,37,FOLLOW_37_in_listProductionPow513); if (state.failed) return listProductionPow;
            match(input,39,FOLLOW_39_in_listProductionPow515); if (state.failed) return listProductionPow;
            match(input,36,FOLLOW_36_in_listProductionPow517); if (state.failed) return listProductionPow;
            pushFollow(FOLLOW_terminal_in_listProductionPow527);
            tempLit=terminal();

            state._fsp--;
            if (state.failed) return listProductionPow;
            if ( state.backtracking==0 ) {
              listProductionPow.setLit(tempLit);
            }
            match(input,37,FOLLOW_37_in_listProductionPow540); if (state.failed) return listProductionPow;
            match(input,33,FOLLOW_33_in_listProductionPow542); if (state.failed) return listProductionPow;
            if ( state.backtracking==0 ) {
              listProductionPow.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 7, listProductionPow_StartIndex); }
        }
        return listProductionPow;
    }
    // $ANTLR end "listProductionPow"


    // $ANTLR start "listElementType"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:126:1: listElementType returns [ListElementType value] : (productionReferenceLabel= productionReference | referenceElementLabel= referenceElement ) ;
    public final ListElementType listElementType() throws RecognitionException {
        ListElementType value = null;
        int listElementType_StartIndex = input.index();
        ProductionReference productionReferenceLabel = null;

        ReferenceElement referenceElementLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:127:5: ( (productionReferenceLabel= productionReference | referenceElementLabel= referenceElement ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:127:6: (productionReferenceLabel= productionReference | referenceElementLabel= referenceElement )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:127:6: (productionReferenceLabel= productionReference | referenceElementLabel= referenceElement )
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==IDENT) ) {
                alt6=1;
            }
            else if ( (LA6_0==40) ) {
                alt6=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;
            }
            switch (alt6) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:127:7: productionReferenceLabel= productionReference
                    {
                    pushFollow(FOLLOW_productionReference_in_listElementType571);
                    productionReferenceLabel=productionReference();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = productionReferenceLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:129:6: referenceElementLabel= referenceElement
                    {
                    pushFollow(FOLLOW_referenceElement_in_listElementType583);
                    referenceElementLabel=referenceElement();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = referenceElementLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 8, listElementType_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "listElementType"


    // $ANTLR start "referenceElement"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:134:1: referenceElement returns [ReferenceElement referenceElement] : 'REFERENCE' ':' productionToken= IDENT ;
    public final ReferenceElement referenceElement() throws RecognitionException {
        ReferenceElement referenceElement = null;
        int referenceElement_StartIndex = input.index();
        Token productionToken=null;


                referenceElement = new ReferenceElement();
                referenceElement.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return referenceElement; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:139:5: ( 'REFERENCE' ':' productionToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:140:1: 'REFERENCE' ':' productionToken= IDENT
            {
            match(input,40,FOLLOW_40_in_referenceElement612); if (state.failed) return referenceElement;
            match(input,32,FOLLOW_32_in_referenceElement614); if (state.failed) return referenceElement;
            productionToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_referenceElement624); if (state.failed) return referenceElement;
            if ( state.backtracking==0 ) {
              identifierMap.resolveReference("typeProduction", productionToken.getText(), "production", referenceElement,tokenInfo(productionToken));
            }
            if ( state.backtracking==0 ) {
              referenceElement.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 9, referenceElement_StartIndex); }
        }
        return referenceElement;
    }
    // $ANTLR end "referenceElement"


    // $ANTLR start "productionReference"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:145:1: productionReference returns [ProductionReference productionReference] : productionToken= IDENT ;
    public final ProductionReference productionReference() throws RecognitionException {
        ProductionReference productionReference = null;
        int productionReference_StartIndex = input.index();
        Token productionToken=null;


                productionReference = new ProductionReference();
                productionReference.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return productionReference; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:150:5: (productionToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:151:5: productionToken= IDENT
            {
            productionToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_productionReference678); if (state.failed) return productionReference;
            if ( state.backtracking==0 ) {
              identifierMap.resolveReference("typeProduction", productionToken.getText(), "production", productionReference,tokenInfo(productionToken));
            }
            if ( state.backtracking==0 ) {
              productionReference.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 10, productionReference_StartIndex); }
        }
        return productionReference;
    }
    // $ANTLR end "productionReference"


    // $ANTLR start "enumProduction"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:156:1: enumProduction returns [EnumProduction enumProduction] : 'enum' nameToken= IDENT ':' tempValues= labelledTerminalList ';' ;
    public final EnumProduction enumProduction() throws RecognitionException {
        EnumProduction enumProduction = null;
        int enumProduction_StartIndex = input.index();
        Token nameToken=null;
        java.util.List tempValues = null;



                enumProduction = new EnumProduction();
                enumProduction.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return enumProduction; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:161:5: ( 'enum' nameToken= IDENT ':' tempValues= labelledTerminalList ';' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:162:1: 'enum' nameToken= IDENT ':' tempValues= labelledTerminalList ';'
            {
            match(input,41,FOLLOW_41_in_enumProduction724); if (state.failed) return enumProduction;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_enumProduction734); if (state.failed) return enumProduction;
            if ( state.backtracking==0 ) {
              enumProduction.setName(nameToken.getText());
            }
            match(input,32,FOLLOW_32_in_enumProduction747); if (state.failed) return enumProduction;
            pushFollow(FOLLOW_labelledTerminalList_in_enumProduction757);
            tempValues=labelledTerminalList();

            state._fsp--;
            if (state.failed) return enumProduction;
            if ( state.backtracking==0 ) {
              enumProduction.setValues(tempValues);
            }
            match(input,33,FOLLOW_33_in_enumProduction770); if (state.failed) return enumProduction;
            if ( state.backtracking==0 ) {
              enumProduction.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 11, enumProduction_StartIndex); }
        }
        return enumProduction;
    }
    // $ANTLR end "enumProduction"


    // $ANTLR start "labelledTerminal"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:169:1: labelledTerminal returns [LabelledTerminal labelledTerminal] : tempTerminal= terminal ':' labelToken= IDENT ;
    public final LabelledTerminal labelledTerminal() throws RecognitionException {
        LabelledTerminal labelledTerminal = null;
        int labelledTerminal_StartIndex = input.index();
        Token labelToken=null;
        Terminal tempTerminal = null;



                labelledTerminal = new LabelledTerminal();
                labelledTerminal.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return labelledTerminal; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:174:5: (tempTerminal= terminal ':' labelToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:175:5: tempTerminal= terminal ':' labelToken= IDENT
            {
            pushFollow(FOLLOW_terminal_in_labelledTerminal813);
            tempTerminal=terminal();

            state._fsp--;
            if (state.failed) return labelledTerminal;
            if ( state.backtracking==0 ) {
              labelledTerminal.setTerminal(tempTerminal);
            }
            match(input,32,FOLLOW_32_in_labelledTerminal826); if (state.failed) return labelledTerminal;
            labelToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_labelledTerminal836); if (state.failed) return labelledTerminal;
            if ( state.backtracking==0 ) {
              labelledTerminal.setLabel(labelToken.getText());
            }
            if ( state.backtracking==0 ) {
              labelledTerminal.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 12, labelledTerminal_StartIndex); }
        }
        return labelledTerminal;
    }
    // $ANTLR end "labelledTerminal"


    // $ANTLR start "labelledTerminalList"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:182:1: labelledTerminalList returns [java.util.List list] : (firstElement= labelledTerminal ( '|' nextElement= labelledTerminal )* )? ;
    public final java.util.List labelledTerminalList() throws RecognitionException {
        java.util.List list = null;
        int labelledTerminalList_StartIndex = input.index();
        LabelledTerminal firstElement = null;

        LabelledTerminal nextElement = null;



               list=new java.util.ArrayList();
           
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return list; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:186:4: ( (firstElement= labelledTerminal ( '|' nextElement= labelledTerminal )* )? )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:186:6: (firstElement= labelledTerminal ( '|' nextElement= labelledTerminal )* )?
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:186:6: (firstElement= labelledTerminal ( '|' nextElement= labelledTerminal )* )?
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( ((LA8_0>=STRING_LITERAL && LA8_0<=CHAR_LITERAL)) ) {
                alt8=1;
            }
            switch (alt8) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:187:8: firstElement= labelledTerminal ( '|' nextElement= labelledTerminal )*
                    {
                    pushFollow(FOLLOW_labelledTerminal_in_labelledTerminalList890);
                    firstElement=labelledTerminal();

                    state._fsp--;
                    if (state.failed) return list;
                    if ( state.backtracking==0 ) {

                                     list.add(firstElement);
                                 
                    }
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:191:8: ( '|' nextElement= labelledTerminal )*
                    loop7:
                    do {
                        int alt7=2;
                        int LA7_0 = input.LA(1);

                        if ( (LA7_0==42) ) {
                            alt7=1;
                        }


                        switch (alt7) {
                    	case 1 :
                    	    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:191:10: '|' nextElement= labelledTerminal
                    	    {
                    	    match(input,42,FOLLOW_42_in_labelledTerminalList914); if (state.failed) return list;
                    	    pushFollow(FOLLOW_labelledTerminal_in_labelledTerminalList918);
                    	    nextElement=labelledTerminal();

                    	    state._fsp--;
                    	    if (state.failed) return list;
                    	    if ( state.backtracking==0 ) {

                    	                     list.add(nextElement);
                    	                 
                    	    }

                    	    }
                    	    break;

                    	default :
                    	    break loop7;
                        }
                    } while (true);


                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 13, labelledTerminalList_StartIndex); }
        }
        return list;
    }
    // $ANTLR end "labelledTerminalList"


    // $ANTLR start "interfaceProduction"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:198:1: interfaceProduction returns [InterfaceProduction interfaceProduction] : 'interface' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempSubTypes= productionReferenceList ';' ;
    public final InterfaceProduction interfaceProduction() throws RecognitionException {
        InterfaceProduction interfaceProduction = null;
        int interfaceProduction_StartIndex = input.index();
        Token nameToken=null;
        Token keyFieldToken=null;
        java.util.List tempSubTypes = null;



                interfaceProduction = new InterfaceProduction();
                interfaceProduction.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return interfaceProduction; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:203:5: ( 'interface' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempSubTypes= productionReferenceList ';' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:204:1: 'interface' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempSubTypes= productionReferenceList ';'
            {
            match(input,43,FOLLOW_43_in_interfaceProduction973); if (state.failed) return interfaceProduction;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_interfaceProduction983); if (state.failed) return interfaceProduction;
            if ( state.backtracking==0 ) {
              interfaceProduction.setName(nameToken.getText());
            }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:206:5: ( '(' 'key' ':' keyFieldToken= IDENT ')' )?
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( (LA9_0==36) ) {
                alt9=1;
            }
            switch (alt9) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:207:1: '(' 'key' ':' keyFieldToken= IDENT ')'
                    {
                    match(input,36,FOLLOW_36_in_interfaceProduction1002); if (state.failed) return interfaceProduction;
                    match(input,44,FOLLOW_44_in_interfaceProduction1004); if (state.failed) return interfaceProduction;
                    match(input,32,FOLLOW_32_in_interfaceProduction1006); if (state.failed) return interfaceProduction;
                    keyFieldToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_interfaceProduction1016); if (state.failed) return interfaceProduction;
                    if ( state.backtracking==0 ) {
                      interfaceProduction.setKeyField(keyFieldToken.getText());
                    }
                    match(input,37,FOLLOW_37_in_interfaceProduction1029); if (state.failed) return interfaceProduction;

                    }
                    break;

            }

            match(input,32,FOLLOW_32_in_interfaceProduction1038); if (state.failed) return interfaceProduction;
            pushFollow(FOLLOW_productionReferenceList_in_interfaceProduction1048);
            tempSubTypes=productionReferenceList();

            state._fsp--;
            if (state.failed) return interfaceProduction;
            if ( state.backtracking==0 ) {
              interfaceProduction.setSubTypes(tempSubTypes);
            }
            match(input,33,FOLLOW_33_in_interfaceProduction1061); if (state.failed) return interfaceProduction;
            if ( state.backtracking==0 ) {
              interfaceProduction.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 14, interfaceProduction_StartIndex); }
        }
        return interfaceProduction;
    }
    // $ANTLR end "interfaceProduction"


    // $ANTLR start "productionReferenceList"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:215:1: productionReferenceList returns [java.util.List list] : (reference= IDENT ( '|' nextReference= IDENT )* )? ;
    public final java.util.List productionReferenceList() throws RecognitionException {
        java.util.List list = null;
        int productionReferenceList_StartIndex = input.index();
        Token reference=null;
        Token nextReference=null;


               list=new java.util.ArrayList();
           
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return list; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:219:4: ( (reference= IDENT ( '|' nextReference= IDENT )* )? )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:219:6: (reference= IDENT ( '|' nextReference= IDENT )* )?
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:219:6: (reference= IDENT ( '|' nextReference= IDENT )* )?
            int alt11=2;
            int LA11_0 = input.LA(1);

            if ( (LA11_0==IDENT) ) {
                alt11=1;
            }
            switch (alt11) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:220:8: reference= IDENT ( '|' nextReference= IDENT )*
                    {
                    reference=(Token)match(input,IDENT,FOLLOW_IDENT_in_productionReferenceList1104); if (state.failed) return list;
                    if ( state.backtracking==0 ) {

                                 list.add(null);
                                 identifierMap.resolveReference("typeProduction",reference.getText(),list,list.size()-1,tokenInfo(reference));
                               
                    }
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:225:8: ( '|' nextReference= IDENT )*
                    loop10:
                    do {
                        int alt10=2;
                        int LA10_0 = input.LA(1);

                        if ( (LA10_0==42) ) {
                            alt10=1;
                        }


                        switch (alt10) {
                    	case 1 :
                    	    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:225:9: '|' nextReference= IDENT
                    	    {
                    	    match(input,42,FOLLOW_42_in_productionReferenceList1125); if (state.failed) return list;
                    	    nextReference=(Token)match(input,IDENT,FOLLOW_IDENT_in_productionReferenceList1129); if (state.failed) return list;
                    	    if ( state.backtracking==0 ) {

                    	                 list.add(null);
                    	                 identifierMap.resolveReference("typeProduction",nextReference.getText(),list,list.size()-1,tokenInfo(nextReference));
                    	               
                    	    }

                    	    }
                    	    break;

                    	default :
                    	    break loop10;
                        }
                    } while (true);


                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 15, productionReferenceList_StartIndex); }
        }
        return list;
    }
    // $ANTLR end "productionReferenceList"


    // $ANTLR start "constructorProduction"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:232:1: constructorProduction returns [ConstructorProduction constructorProduction] : 'class' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempFactors= factorList ';' ;
    public final ConstructorProduction constructorProduction() throws RecognitionException {
        ConstructorProduction constructorProduction = null;
        int constructorProduction_StartIndex = input.index();
        Token nameToken=null;
        Token keyFieldToken=null;
        java.util.List tempFactors = null;



                constructorProduction = new ConstructorProduction();
                constructorProduction.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return constructorProduction; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:237:5: ( 'class' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempFactors= factorList ';' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:238:1: 'class' nameToken= IDENT ( '(' 'key' ':' keyFieldToken= IDENT ')' )? ':' tempFactors= factorList ';'
            {
            match(input,45,FOLLOW_45_in_constructorProduction1172); if (state.failed) return constructorProduction;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_constructorProduction1182); if (state.failed) return constructorProduction;
            if ( state.backtracking==0 ) {
              constructorProduction.setName(nameToken.getText());
            }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:240:5: ( '(' 'key' ':' keyFieldToken= IDENT ')' )?
            int alt12=2;
            int LA12_0 = input.LA(1);

            if ( (LA12_0==36) ) {
                alt12=1;
            }
            switch (alt12) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:241:1: '(' 'key' ':' keyFieldToken= IDENT ')'
                    {
                    match(input,36,FOLLOW_36_in_constructorProduction1201); if (state.failed) return constructorProduction;
                    match(input,44,FOLLOW_44_in_constructorProduction1203); if (state.failed) return constructorProduction;
                    match(input,32,FOLLOW_32_in_constructorProduction1205); if (state.failed) return constructorProduction;
                    keyFieldToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_constructorProduction1215); if (state.failed) return constructorProduction;
                    if ( state.backtracking==0 ) {
                      constructorProduction.setKeyField(keyFieldToken.getText());
                    }
                    match(input,37,FOLLOW_37_in_constructorProduction1228); if (state.failed) return constructorProduction;

                    }
                    break;

            }

            match(input,32,FOLLOW_32_in_constructorProduction1237); if (state.failed) return constructorProduction;
            pushFollow(FOLLOW_factorList_in_constructorProduction1247);
            tempFactors=factorList();

            state._fsp--;
            if (state.failed) return constructorProduction;
            if ( state.backtracking==0 ) {
              constructorProduction.setFactors(tempFactors);
            }
            match(input,33,FOLLOW_33_in_constructorProduction1260); if (state.failed) return constructorProduction;
            if ( state.backtracking==0 ) {
              constructorProduction.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 16, constructorProduction_StartIndex); }
        }
        return constructorProduction;
    }
    // $ANTLR end "constructorProduction"


    // $ANTLR start "factorList"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:249:1: factorList returns [java.util.List list] : (listElement= productionFactor )* ;
    public final java.util.List factorList() throws RecognitionException {
        java.util.List list = null;
        int factorList_StartIndex = input.index();
        ProductionFactor listElement = null;



               list=new java.util.ArrayList();
           
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return list; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:253:4: ( (listElement= productionFactor )* )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:253:6: (listElement= productionFactor )*
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:253:6: (listElement= productionFactor )*
            loop13:
            do {
                int alt13=2;
                int LA13_0 = input.LA(1);

                if ( ((LA13_0>=IDENT && LA13_0<=CHAR_LITERAL)||LA13_0==40||LA13_0==46||(LA13_0>=48 && LA13_0<=54)) ) {
                    alt13=1;
                }


                switch (alt13) {
            	case 1 :
            	    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:254:8: listElement= productionFactor
            	    {
            	    pushFollow(FOLLOW_productionFactor_in_factorList1303);
            	    listElement=productionFactor();

            	    state._fsp--;
            	    if (state.failed) return list;
            	    if ( state.backtracking==0 ) {

            	                     list.add(listElement);
            	                 
            	    }

            	    }
            	    break;

            	default :
            	    break loop13;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 17, factorList_StartIndex); }
        }
        return list;
    }
    // $ANTLR end "factorList"


    // $ANTLR start "productionFactor"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:260:1: productionFactor returns [ProductionFactor value] : (terminalLabel= terminal | attributeLabel= attribute | optionalAttributeListLabel= optionalAttributeList ) ;
    public final ProductionFactor productionFactor() throws RecognitionException {
        ProductionFactor value = null;
        int productionFactor_StartIndex = input.index();
        Terminal terminalLabel = null;

        Attribute attributeLabel = null;

        OptionalAttributeList optionalAttributeListLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:261:5: ( (terminalLabel= terminal | attributeLabel= attribute | optionalAttributeListLabel= optionalAttributeList ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:261:6: (terminalLabel= terminal | attributeLabel= attribute | optionalAttributeListLabel= optionalAttributeList )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:261:6: (terminalLabel= terminal | attributeLabel= attribute | optionalAttributeListLabel= optionalAttributeList )
            int alt14=3;
            switch ( input.LA(1) ) {
            case STRING_LITERAL:
            case CHAR_LITERAL:
                {
                alt14=1;
                }
                break;
            case IDENT:
            case 40:
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
                {
                alt14=2;
                }
                break;
            case 46:
                {
                alt14=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 14, 0, input);

                throw nvae;
            }

            switch (alt14) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:261:7: terminalLabel= terminal
                    {
                    pushFollow(FOLLOW_terminal_in_productionFactor1340);
                    terminalLabel=terminal();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = terminalLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:263:6: attributeLabel= attribute
                    {
                    pushFollow(FOLLOW_attribute_in_productionFactor1352);
                    attributeLabel=attribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = attributeLabel;
                    }

                    }
                    break;
                case 3 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:265:6: optionalAttributeListLabel= optionalAttributeList
                    {
                    pushFollow(FOLLOW_optionalAttributeList_in_productionFactor1364);
                    optionalAttributeListLabel=optionalAttributeList();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = optionalAttributeListLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 18, productionFactor_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "productionFactor"


    // $ANTLR start "optionalAttributeList"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:270:1: optionalAttributeList returns [OptionalAttributeList optionalAttributeList] : '[' tempFactors= factorList ']' ;
    public final OptionalAttributeList optionalAttributeList() throws RecognitionException {
        OptionalAttributeList optionalAttributeList = null;
        int optionalAttributeList_StartIndex = input.index();
        java.util.List tempFactors = null;



                optionalAttributeList = new OptionalAttributeList();
                optionalAttributeList.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return optionalAttributeList; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:275:5: ( '[' tempFactors= factorList ']' )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:276:1: '[' tempFactors= factorList ']'
            {
            match(input,46,FOLLOW_46_in_optionalAttributeList1393); if (state.failed) return optionalAttributeList;
            pushFollow(FOLLOW_factorList_in_optionalAttributeList1403);
            tempFactors=factorList();

            state._fsp--;
            if (state.failed) return optionalAttributeList;
            if ( state.backtracking==0 ) {
              optionalAttributeList.setFactors(tempFactors);
            }
            match(input,47,FOLLOW_47_in_optionalAttributeList1416); if (state.failed) return optionalAttributeList;
            if ( state.backtracking==0 ) {
              optionalAttributeList.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 19, optionalAttributeList_StartIndex); }
        }
        return optionalAttributeList;
    }
    // $ANTLR end "optionalAttributeList"


    // $ANTLR start "deepAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:281:1: deepAttribute returns [DeepAttribute deepAttribute] : productionToken= IDENT ( ':' nameToken= IDENT )? ;
    public final DeepAttribute deepAttribute() throws RecognitionException {
        DeepAttribute deepAttribute = null;
        int deepAttribute_StartIndex = input.index();
        Token productionToken=null;
        Token nameToken=null;


                deepAttribute = new DeepAttribute();
                deepAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return deepAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:286:5: (productionToken= IDENT ( ':' nameToken= IDENT )? )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:287:5: productionToken= IDENT ( ':' nameToken= IDENT )?
            {
            productionToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_deepAttribute1459); if (state.failed) return deepAttribute;
            if ( state.backtracking==0 ) {
              identifierMap.resolveReference("production", productionToken.getText(), "production", deepAttribute,tokenInfo(productionToken));
            }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:289:5: ( ':' nameToken= IDENT )?
            int alt15=2;
            int LA15_0 = input.LA(1);

            if ( (LA15_0==32) ) {
                alt15=1;
            }
            switch (alt15) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:290:1: ':' nameToken= IDENT
                    {
                    match(input,32,FOLLOW_32_in_deepAttribute1478); if (state.failed) return deepAttribute;
                    nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_deepAttribute1488); if (state.failed) return deepAttribute;
                    if ( state.backtracking==0 ) {
                      deepAttribute.setName(nameToken.getText());
                    }

                    }
                    break;

            }

            if ( state.backtracking==0 ) {
              deepAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 20, deepAttribute_StartIndex); }
        }
        return deepAttribute;
    }
    // $ANTLR end "deepAttribute"


    // $ANTLR start "flatAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:296:1: flatAttribute returns [FlatAttribute value] : (intLiteralAttributeLabel= intLiteralAttribute | doubleLiteralAttributeLabel= doubleLiteralAttribute | charLiteralAttributeLabel= charLiteralAttribute | booleanLiteralAttributeLabel= booleanLiteralAttribute | stringLiteralAttributeLabel= stringLiteralAttribute | identifierAttributeLabel= identifierAttribute | referenceAttributeLabel= referenceAttribute | multiLineStringAttributeLabel= multiLineStringAttribute ) ;
    public final FlatAttribute flatAttribute() throws RecognitionException {
        FlatAttribute value = null;
        int flatAttribute_StartIndex = input.index();
        IntLiteralAttribute intLiteralAttributeLabel = null;

        DoubleLiteralAttribute doubleLiteralAttributeLabel = null;

        CharLiteralAttribute charLiteralAttributeLabel = null;

        BooleanLiteralAttribute booleanLiteralAttributeLabel = null;

        StringLiteralAttribute stringLiteralAttributeLabel = null;

        IdentifierAttribute identifierAttributeLabel = null;

        ReferenceAttribute referenceAttributeLabel = null;

        MultiLineStringAttribute multiLineStringAttributeLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 21) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:297:5: ( (intLiteralAttributeLabel= intLiteralAttribute | doubleLiteralAttributeLabel= doubleLiteralAttribute | charLiteralAttributeLabel= charLiteralAttribute | booleanLiteralAttributeLabel= booleanLiteralAttribute | stringLiteralAttributeLabel= stringLiteralAttribute | identifierAttributeLabel= identifierAttribute | referenceAttributeLabel= referenceAttribute | multiLineStringAttributeLabel= multiLineStringAttribute ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:297:6: (intLiteralAttributeLabel= intLiteralAttribute | doubleLiteralAttributeLabel= doubleLiteralAttribute | charLiteralAttributeLabel= charLiteralAttribute | booleanLiteralAttributeLabel= booleanLiteralAttribute | stringLiteralAttributeLabel= stringLiteralAttribute | identifierAttributeLabel= identifierAttribute | referenceAttributeLabel= referenceAttribute | multiLineStringAttributeLabel= multiLineStringAttribute )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:297:6: (intLiteralAttributeLabel= intLiteralAttribute | doubleLiteralAttributeLabel= doubleLiteralAttribute | charLiteralAttributeLabel= charLiteralAttribute | booleanLiteralAttributeLabel= booleanLiteralAttribute | stringLiteralAttributeLabel= stringLiteralAttribute | identifierAttributeLabel= identifierAttribute | referenceAttributeLabel= referenceAttribute | multiLineStringAttributeLabel= multiLineStringAttribute )
            int alt16=8;
            switch ( input.LA(1) ) {
            case 51:
                {
                alt16=1;
                }
                break;
            case 53:
                {
                alt16=2;
                }
                break;
            case 48:
                {
                alt16=3;
                }
                break;
            case 54:
                {
                alt16=4;
                }
                break;
            case 49:
                {
                alt16=5;
                }
                break;
            case 52:
                {
                alt16=6;
                }
                break;
            case 40:
                {
                alt16=7;
                }
                break;
            case 50:
                {
                alt16=8;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 16, 0, input);

                throw nvae;
            }

            switch (alt16) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:297:7: intLiteralAttributeLabel= intLiteralAttribute
                    {
                    pushFollow(FOLLOW_intLiteralAttribute_in_flatAttribute1535);
                    intLiteralAttributeLabel=intLiteralAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = intLiteralAttributeLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:299:6: doubleLiteralAttributeLabel= doubleLiteralAttribute
                    {
                    pushFollow(FOLLOW_doubleLiteralAttribute_in_flatAttribute1547);
                    doubleLiteralAttributeLabel=doubleLiteralAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = doubleLiteralAttributeLabel;
                    }

                    }
                    break;
                case 3 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:301:6: charLiteralAttributeLabel= charLiteralAttribute
                    {
                    pushFollow(FOLLOW_charLiteralAttribute_in_flatAttribute1559);
                    charLiteralAttributeLabel=charLiteralAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = charLiteralAttributeLabel;
                    }

                    }
                    break;
                case 4 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:303:6: booleanLiteralAttributeLabel= booleanLiteralAttribute
                    {
                    pushFollow(FOLLOW_booleanLiteralAttribute_in_flatAttribute1571);
                    booleanLiteralAttributeLabel=booleanLiteralAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = booleanLiteralAttributeLabel;
                    }

                    }
                    break;
                case 5 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:305:6: stringLiteralAttributeLabel= stringLiteralAttribute
                    {
                    pushFollow(FOLLOW_stringLiteralAttribute_in_flatAttribute1583);
                    stringLiteralAttributeLabel=stringLiteralAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = stringLiteralAttributeLabel;
                    }

                    }
                    break;
                case 6 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:307:6: identifierAttributeLabel= identifierAttribute
                    {
                    pushFollow(FOLLOW_identifierAttribute_in_flatAttribute1595);
                    identifierAttributeLabel=identifierAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = identifierAttributeLabel;
                    }

                    }
                    break;
                case 7 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:309:6: referenceAttributeLabel= referenceAttribute
                    {
                    pushFollow(FOLLOW_referenceAttribute_in_flatAttribute1607);
                    referenceAttributeLabel=referenceAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = referenceAttributeLabel;
                    }

                    }
                    break;
                case 8 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:311:6: multiLineStringAttributeLabel= multiLineStringAttribute
                    {
                    pushFollow(FOLLOW_multiLineStringAttribute_in_flatAttribute1619);
                    multiLineStringAttributeLabel=multiLineStringAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = multiLineStringAttributeLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 21, flatAttribute_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "flatAttribute"


    // $ANTLR start "charLiteralAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:316:1: charLiteralAttribute returns [CharLiteralAttribute charLiteralAttribute] : 'CHAR_LITERAL' ':' nameToken= IDENT ;
    public final CharLiteralAttribute charLiteralAttribute() throws RecognitionException {
        CharLiteralAttribute charLiteralAttribute = null;
        int charLiteralAttribute_StartIndex = input.index();
        Token nameToken=null;


                charLiteralAttribute = new CharLiteralAttribute();
                charLiteralAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 22) ) { return charLiteralAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:321:5: ( 'CHAR_LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:322:1: 'CHAR_LITERAL' ':' nameToken= IDENT
            {
            match(input,48,FOLLOW_48_in_charLiteralAttribute1648); if (state.failed) return charLiteralAttribute;
            match(input,32,FOLLOW_32_in_charLiteralAttribute1650); if (state.failed) return charLiteralAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_charLiteralAttribute1660); if (state.failed) return charLiteralAttribute;
            if ( state.backtracking==0 ) {
              charLiteralAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              charLiteralAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 22, charLiteralAttribute_StartIndex); }
        }
        return charLiteralAttribute;
    }
    // $ANTLR end "charLiteralAttribute"


    // $ANTLR start "stringLiteralAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:327:1: stringLiteralAttribute returns [StringLiteralAttribute stringLiteralAttribute] : 'LITERAL' ':' nameToken= IDENT ;
    public final StringLiteralAttribute stringLiteralAttribute() throws RecognitionException {
        StringLiteralAttribute stringLiteralAttribute = null;
        int stringLiteralAttribute_StartIndex = input.index();
        Token nameToken=null;


                stringLiteralAttribute = new StringLiteralAttribute();
                stringLiteralAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 23) ) { return stringLiteralAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:332:5: ( 'LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:333:1: 'LITERAL' ':' nameToken= IDENT
            {
            match(input,49,FOLLOW_49_in_stringLiteralAttribute1706); if (state.failed) return stringLiteralAttribute;
            match(input,32,FOLLOW_32_in_stringLiteralAttribute1708); if (state.failed) return stringLiteralAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_stringLiteralAttribute1718); if (state.failed) return stringLiteralAttribute;
            if ( state.backtracking==0 ) {
              stringLiteralAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              stringLiteralAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 23, stringLiteralAttribute_StartIndex); }
        }
        return stringLiteralAttribute;
    }
    // $ANTLR end "stringLiteralAttribute"


    // $ANTLR start "multiLineStringAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:338:1: multiLineStringAttribute returns [MultiLineStringAttribute multiLineStringAttribute] : 'MULTI_LINE_LITERAL' ':' nameToken= IDENT ;
    public final MultiLineStringAttribute multiLineStringAttribute() throws RecognitionException {
        MultiLineStringAttribute multiLineStringAttribute = null;
        int multiLineStringAttribute_StartIndex = input.index();
        Token nameToken=null;


                multiLineStringAttribute = new MultiLineStringAttribute();
                multiLineStringAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return multiLineStringAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:343:5: ( 'MULTI_LINE_LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:344:1: 'MULTI_LINE_LITERAL' ':' nameToken= IDENT
            {
            match(input,50,FOLLOW_50_in_multiLineStringAttribute1764); if (state.failed) return multiLineStringAttribute;
            match(input,32,FOLLOW_32_in_multiLineStringAttribute1766); if (state.failed) return multiLineStringAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_multiLineStringAttribute1776); if (state.failed) return multiLineStringAttribute;
            if ( state.backtracking==0 ) {
              multiLineStringAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              multiLineStringAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 24, multiLineStringAttribute_StartIndex); }
        }
        return multiLineStringAttribute;
    }
    // $ANTLR end "multiLineStringAttribute"


    // $ANTLR start "intLiteralAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:349:1: intLiteralAttribute returns [IntLiteralAttribute intLiteralAttribute] : 'INT_LITERAL' ':' nameToken= IDENT ;
    public final IntLiteralAttribute intLiteralAttribute() throws RecognitionException {
        IntLiteralAttribute intLiteralAttribute = null;
        int intLiteralAttribute_StartIndex = input.index();
        Token nameToken=null;


                intLiteralAttribute = new IntLiteralAttribute();
                intLiteralAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 25) ) { return intLiteralAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:354:5: ( 'INT_LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:355:1: 'INT_LITERAL' ':' nameToken= IDENT
            {
            match(input,51,FOLLOW_51_in_intLiteralAttribute1822); if (state.failed) return intLiteralAttribute;
            match(input,32,FOLLOW_32_in_intLiteralAttribute1824); if (state.failed) return intLiteralAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_intLiteralAttribute1834); if (state.failed) return intLiteralAttribute;
            if ( state.backtracking==0 ) {
              intLiteralAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              intLiteralAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 25, intLiteralAttribute_StartIndex); }
        }
        return intLiteralAttribute;
    }
    // $ANTLR end "intLiteralAttribute"


    // $ANTLR start "identifierAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:360:1: identifierAttribute returns [IdentifierAttribute identifierAttribute] : 'IDENTIFIER' ':' nameToken= IDENT ;
    public final IdentifierAttribute identifierAttribute() throws RecognitionException {
        IdentifierAttribute identifierAttribute = null;
        int identifierAttribute_StartIndex = input.index();
        Token nameToken=null;


                identifierAttribute = new IdentifierAttribute();
                identifierAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return identifierAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:365:5: ( 'IDENTIFIER' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:366:1: 'IDENTIFIER' ':' nameToken= IDENT
            {
            match(input,52,FOLLOW_52_in_identifierAttribute1880); if (state.failed) return identifierAttribute;
            match(input,32,FOLLOW_32_in_identifierAttribute1882); if (state.failed) return identifierAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_identifierAttribute1892); if (state.failed) return identifierAttribute;
            if ( state.backtracking==0 ) {
              identifierAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              identifierAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 26, identifierAttribute_StartIndex); }
        }
        return identifierAttribute;
    }
    // $ANTLR end "identifierAttribute"


    // $ANTLR start "doubleLiteralAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:371:1: doubleLiteralAttribute returns [DoubleLiteralAttribute doubleLiteralAttribute] : 'DOUBLE_LITERAL' ':' nameToken= IDENT ;
    public final DoubleLiteralAttribute doubleLiteralAttribute() throws RecognitionException {
        DoubleLiteralAttribute doubleLiteralAttribute = null;
        int doubleLiteralAttribute_StartIndex = input.index();
        Token nameToken=null;


                doubleLiteralAttribute = new DoubleLiteralAttribute();
                doubleLiteralAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 27) ) { return doubleLiteralAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:376:5: ( 'DOUBLE_LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:377:1: 'DOUBLE_LITERAL' ':' nameToken= IDENT
            {
            match(input,53,FOLLOW_53_in_doubleLiteralAttribute1938); if (state.failed) return doubleLiteralAttribute;
            match(input,32,FOLLOW_32_in_doubleLiteralAttribute1940); if (state.failed) return doubleLiteralAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_doubleLiteralAttribute1950); if (state.failed) return doubleLiteralAttribute;
            if ( state.backtracking==0 ) {
              doubleLiteralAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              doubleLiteralAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 27, doubleLiteralAttribute_StartIndex); }
        }
        return doubleLiteralAttribute;
    }
    // $ANTLR end "doubleLiteralAttribute"


    // $ANTLR start "booleanLiteralAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:382:1: booleanLiteralAttribute returns [BooleanLiteralAttribute booleanLiteralAttribute] : 'BOOLEAN_LITERAL' ':' nameToken= IDENT ;
    public final BooleanLiteralAttribute booleanLiteralAttribute() throws RecognitionException {
        BooleanLiteralAttribute booleanLiteralAttribute = null;
        int booleanLiteralAttribute_StartIndex = input.index();
        Token nameToken=null;


                booleanLiteralAttribute = new BooleanLiteralAttribute();
                booleanLiteralAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 28) ) { return booleanLiteralAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:387:5: ( 'BOOLEAN_LITERAL' ':' nameToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:388:1: 'BOOLEAN_LITERAL' ':' nameToken= IDENT
            {
            match(input,54,FOLLOW_54_in_booleanLiteralAttribute1996); if (state.failed) return booleanLiteralAttribute;
            match(input,32,FOLLOW_32_in_booleanLiteralAttribute1998); if (state.failed) return booleanLiteralAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_booleanLiteralAttribute2008); if (state.failed) return booleanLiteralAttribute;
            if ( state.backtracking==0 ) {
              booleanLiteralAttribute.setName(nameToken.getText());
            }
            if ( state.backtracking==0 ) {
              booleanLiteralAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 28, booleanLiteralAttribute_StartIndex); }
        }
        return booleanLiteralAttribute;
    }
    // $ANTLR end "booleanLiteralAttribute"


    // $ANTLR start "referenceAttribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:393:1: referenceAttribute returns [ReferenceAttribute referenceAttribute] : 'REFERENCE' ':' nameToken= IDENT ':' productionToken= IDENT ;
    public final ReferenceAttribute referenceAttribute() throws RecognitionException {
        ReferenceAttribute referenceAttribute = null;
        int referenceAttribute_StartIndex = input.index();
        Token nameToken=null;
        Token productionToken=null;


                referenceAttribute = new ReferenceAttribute();
                referenceAttribute.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 29) ) { return referenceAttribute; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:398:5: ( 'REFERENCE' ':' nameToken= IDENT ':' productionToken= IDENT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:399:1: 'REFERENCE' ':' nameToken= IDENT ':' productionToken= IDENT
            {
            match(input,40,FOLLOW_40_in_referenceAttribute2054); if (state.failed) return referenceAttribute;
            match(input,32,FOLLOW_32_in_referenceAttribute2056); if (state.failed) return referenceAttribute;
            nameToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_referenceAttribute2066); if (state.failed) return referenceAttribute;
            if ( state.backtracking==0 ) {
              referenceAttribute.setName(nameToken.getText());
            }
            match(input,32,FOLLOW_32_in_referenceAttribute2079); if (state.failed) return referenceAttribute;
            productionToken=(Token)match(input,IDENT,FOLLOW_IDENT_in_referenceAttribute2089); if (state.failed) return referenceAttribute;
            if ( state.backtracking==0 ) {
              identifierMap.resolveReference("typeProduction", productionToken.getText(), "production", referenceAttribute,tokenInfo(productionToken));
            }
            if ( state.backtracking==0 ) {
              referenceAttribute.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 29, referenceAttribute_StartIndex); }
        }
        return referenceAttribute;
    }
    // $ANTLR end "referenceAttribute"


    // $ANTLR start "attribute"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:406:1: attribute returns [Attribute value] : (deepAttributeLabel= deepAttribute | flatAttributeLabel= flatAttribute ) ;
    public final Attribute attribute() throws RecognitionException {
        Attribute value = null;
        int attribute_StartIndex = input.index();
        DeepAttribute deepAttributeLabel = null;

        FlatAttribute flatAttributeLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 30) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:407:5: ( (deepAttributeLabel= deepAttribute | flatAttributeLabel= flatAttribute ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:407:6: (deepAttributeLabel= deepAttribute | flatAttributeLabel= flatAttribute )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:407:6: (deepAttributeLabel= deepAttribute | flatAttributeLabel= flatAttribute )
            int alt17=2;
            int LA17_0 = input.LA(1);

            if ( (LA17_0==IDENT) ) {
                alt17=1;
            }
            else if ( (LA17_0==40||(LA17_0>=48 && LA17_0<=54)) ) {
                alt17=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                throw nvae;
            }
            switch (alt17) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:407:7: deepAttributeLabel= deepAttribute
                    {
                    pushFollow(FOLLOW_deepAttribute_in_attribute2129);
                    deepAttributeLabel=deepAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = deepAttributeLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:409:6: flatAttributeLabel= flatAttribute
                    {
                    pushFollow(FOLLOW_flatAttribute_in_attribute2141);
                    flatAttributeLabel=flatAttribute();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = flatAttributeLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 30, attribute_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "attribute"


    // $ANTLR start "charToken"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:414:1: charToken returns [CharToken charToken] : textCToken= CHAR_LITERAL ;
    public final CharToken charToken() throws RecognitionException {
        CharToken charToken = null;
        int charToken_StartIndex = input.index();
        Token textCToken=null;


                charToken = new CharToken();
                charToken.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 31) ) { return charToken; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:419:5: (textCToken= CHAR_LITERAL )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:420:5: textCToken= CHAR_LITERAL
            {
            textCToken=(Token)match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charToken2177); if (state.failed) return charToken;
            if ( state.backtracking==0 ) {
              charToken.setText(StringEscapeUtils.unescapeJava(textCToken.getText().substring(1,textCToken.getText().length()-1)).charAt(0));
            }
            if ( state.backtracking==0 ) {
              charToken.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 31, charToken_StartIndex); }
        }
        return charToken;
    }
    // $ANTLR end "charToken"


    // $ANTLR start "keyword"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:425:1: keyword returns [Keyword keyword] : textToken= STRING_LITERAL ;
    public final Keyword keyword() throws RecognitionException {
        Keyword keyword = null;
        int keyword_StartIndex = input.index();
        Token textToken=null;


                keyword = new Keyword();
                keyword.mSetStart(new Position(((TokenStream)input).LT(1)));
            
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 32) ) { return keyword; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:430:5: (textToken= STRING_LITERAL )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:431:5: textToken= STRING_LITERAL
            {
            textToken=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_keyword2230); if (state.failed) return keyword;
            if ( state.backtracking==0 ) {
              keyword.setText(StringEscapeUtils.unescapeJava(textToken.getText().substring(1,textToken.getText().length()-1)));
            }
            if ( state.backtracking==0 ) {
              keyword.mSetEnd(new Position(((TokenStream)input).LT(0)));
            }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 32, keyword_StartIndex); }
        }
        return keyword;
    }
    // $ANTLR end "keyword"


    // $ANTLR start "terminal"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:436:1: terminal returns [Terminal value] : (charTokenLabel= charToken | keywordLabel= keyword ) ;
    public final Terminal terminal() throws RecognitionException {
        Terminal value = null;
        int terminal_StartIndex = input.index();
        CharToken charTokenLabel = null;

        Keyword keywordLabel = null;


        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 33) ) { return value; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:437:5: ( (charTokenLabel= charToken | keywordLabel= keyword ) )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:437:6: (charTokenLabel= charToken | keywordLabel= keyword )
            {
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:437:6: (charTokenLabel= charToken | keywordLabel= keyword )
            int alt18=2;
            int LA18_0 = input.LA(1);

            if ( (LA18_0==CHAR_LITERAL) ) {
                alt18=1;
            }
            else if ( (LA18_0==STRING_LITERAL) ) {
                alt18=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 18, 0, input);

                throw nvae;
            }
            switch (alt18) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:437:7: charTokenLabel= charToken
                    {
                    pushFollow(FOLLOW_charToken_in_terminal2270);
                    charTokenLabel=charToken();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = charTokenLabel;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:439:6: keywordLabel= keyword
                    {
                    pushFollow(FOLLOW_keyword_in_terminal2282);
                    keywordLabel=keyword();

                    state._fsp--;
                    if (state.failed) return value;
                    if ( state.backtracking==0 ) {
                      value = keywordLabel;
                    }

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 33, terminal_StartIndex); }
        }
        return value;
    }
    // $ANTLR end "terminal"


    // $ANTLR start "booleanLiteral"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:447:1: booleanLiteral returns [boolean flag] : ( TRUE | FALSE );
    public final boolean booleanLiteral() throws RecognitionException {
        boolean flag = false;
        int booleanLiteral_StartIndex = input.index();
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 34) ) { return flag; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:447:38: ( TRUE | FALSE )
            int alt19=2;
            int LA19_0 = input.LA(1);

            if ( (LA19_0==TRUE) ) {
                alt19=1;
            }
            else if ( (LA19_0==FALSE) ) {
                alt19=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return flag;}
                NoViableAltException nvae =
                    new NoViableAltException("", 19, 0, input);

                throw nvae;
            }
            switch (alt19) {
                case 1 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:448:3: TRUE
                    {
                    match(input,TRUE,FOLLOW_TRUE_in_booleanLiteral2303); if (state.failed) return flag;
                    if ( state.backtracking==0 ) {
                      flag=true;
                    }

                    }
                    break;
                case 2 :
                    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:451:3: FALSE
                    {
                    match(input,FALSE,FOLLOW_FALSE_in_booleanLiteral2315); if (state.failed) return flag;
                    if ( state.backtracking==0 ) {
                      flag=false;
                    }

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 34, booleanLiteral_StartIndex); }
        }
        return flag;
    }
    // $ANTLR end "booleanLiteral"


    // $ANTLR start "constant"
    // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:455:1: constant : ( NUM_LONG | NUM_FLOAT | NUM_INT | NUM_DOUBLE | DOT );
    public final void constant() throws RecognitionException {
        int constant_StartIndex = input.index();
        try {
            if ( state.backtracking>0 && alreadyParsedRule(input, 35) ) { return ; }
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:456:2: ( NUM_LONG | NUM_FLOAT | NUM_INT | NUM_DOUBLE | DOT )
            // /Users/fleipold/development/java/temp/lang4j/gen-src/lang4j/parser/generated/Lang4j.g:
            {
            if ( (input.LA(1)>=NUM_LONG && input.LA(1)<=DOT) ) {
                input.consume();
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return ;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
            if ( state.backtracking>0 ) { memoize(input, 35, constant_StartIndex); }
        }
        return ;
    }
    // $ANTLR end "constant"

    // Delegated rules


    protected DFA5 dfa5 = new DFA5(this);
    static final String DFA5_eotS =
        "\14\uffff";
    static final String DFA5_eofS =
        "\14\uffff";
    static final String DFA5_minS =
        "\1\43\1\5\1\40\1\44\1\5\1\45\1\40\1\46\1\5\2\uffff\1\45";
    static final String DFA5_maxS =
        "\1\43\1\5\1\40\1\44\1\50\1\45\1\40\1\47\1\5\2\uffff\1\45";
    static final String DFA5_acceptS =
        "\11\uffff\1\1\1\2\1\uffff";
    static final String DFA5_specialS =
        "\14\uffff}>";
    static final String[] DFA5_transitionS = {
            "\1\1",
            "\1\2",
            "\1\3",
            "\1\4",
            "\1\5\42\uffff\1\6",
            "\1\7",
            "\1\10",
            "\1\11\1\12",
            "\1\13",
            "",
            "",
            "\1\7"
    };

    static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
    static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
    static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
    static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
    static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
    static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
    static final short[][] DFA5_transition;

    static {
        int numStates = DFA5_transitionS.length;
        DFA5_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA5_transition[i] = DFA.unpackEncodedString(DFA5_transitionS[i]);
        }
    }

    class DFA5 extends DFA {

        public DFA5(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 5;
            this.eot = DFA5_eot;
            this.eof = DFA5_eof;
            this.min = DFA5_min;
            this.max = DFA5_max;
            this.accept = DFA5_accept;
            this.special = DFA5_special;
            this.transition = DFA5_transition;
        }
        public String getDescription() {
            return "91:6: (listProductionStarLabel= listProductionStar | listProductionPowLabel= listProductionPow )";
        }
    }
 

    public static final BitSet FOLLOW_production_in_productionList70 = new BitSet(new long[]{0x00002A0800000002L});
    public static final BitSet FOLLOW_MULTI_LINE_STRING_in_lang4jGrammar126 = new BitSet(new long[]{0x0000000080000000L});
    public static final BitSet FOLLOW_31_in_lang4jGrammar146 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_lang4jGrammar148 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_lang4jGrammar158 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_lang4jGrammar171 = new BitSet(new long[]{0x0000000400000000L});
    public static final BitSet FOLLOW_34_in_lang4jGrammar173 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_lang4jGrammar175 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_lang4jGrammar184 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_lang4jGrammar197 = new BitSet(new long[]{0x00002A0800000000L});
    public static final BitSet FOLLOW_productionList_in_lang4jGrammar207 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_enumProduction_in_production251 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_typeProduction_in_production263 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_listProduction_in_production275 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_interfaceProduction_in_typeProduction302 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_constructorProduction_in_typeProduction314 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_listProductionStar_in_listProduction337 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_listProductionPow_in_listProduction349 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_35_in_listProductionStar378 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_listProductionStar388 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_listProductionStar401 = new BitSet(new long[]{0x0000001000000000L});
    public static final BitSet FOLLOW_36_in_listProductionStar403 = new BitSet(new long[]{0x0000010000000020L});
    public static final BitSet FOLLOW_listElementType_in_listProductionStar413 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_listProductionStar426 = new BitSet(new long[]{0x0000004000000000L});
    public static final BitSet FOLLOW_38_in_listProductionStar428 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_listProductionStar430 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_35_in_listProductionPow465 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_listProductionPow475 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_listProductionPow488 = new BitSet(new long[]{0x0000001000000000L});
    public static final BitSet FOLLOW_36_in_listProductionPow490 = new BitSet(new long[]{0x0000010000000020L});
    public static final BitSet FOLLOW_listElementType_in_listProductionPow500 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_listProductionPow513 = new BitSet(new long[]{0x0000008000000000L});
    public static final BitSet FOLLOW_39_in_listProductionPow515 = new BitSet(new long[]{0x0000001000000000L});
    public static final BitSet FOLLOW_36_in_listProductionPow517 = new BitSet(new long[]{0x00000000000000C0L});
    public static final BitSet FOLLOW_terminal_in_listProductionPow527 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_listProductionPow540 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_listProductionPow542 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_productionReference_in_listElementType571 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_referenceElement_in_listElementType583 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_40_in_referenceElement612 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_referenceElement614 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_referenceElement624 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_productionReference678 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_enumProduction724 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_enumProduction734 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_enumProduction747 = new BitSet(new long[]{0x00000002000000C0L});
    public static final BitSet FOLLOW_labelledTerminalList_in_enumProduction757 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_enumProduction770 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_terminal_in_labelledTerminal813 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_labelledTerminal826 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_labelledTerminal836 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_labelledTerminal_in_labelledTerminalList890 = new BitSet(new long[]{0x0000040000000002L});
    public static final BitSet FOLLOW_42_in_labelledTerminalList914 = new BitSet(new long[]{0x00000000000000C0L});
    public static final BitSet FOLLOW_labelledTerminal_in_labelledTerminalList918 = new BitSet(new long[]{0x0000040000000002L});
    public static final BitSet FOLLOW_43_in_interfaceProduction973 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_interfaceProduction983 = new BitSet(new long[]{0x0000001100000000L});
    public static final BitSet FOLLOW_36_in_interfaceProduction1002 = new BitSet(new long[]{0x0000100000000000L});
    public static final BitSet FOLLOW_44_in_interfaceProduction1004 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_interfaceProduction1006 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_interfaceProduction1016 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_interfaceProduction1029 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_interfaceProduction1038 = new BitSet(new long[]{0x0000000200000020L});
    public static final BitSet FOLLOW_productionReferenceList_in_interfaceProduction1048 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_interfaceProduction1061 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_productionReferenceList1104 = new BitSet(new long[]{0x0000040000000002L});
    public static final BitSet FOLLOW_42_in_productionReferenceList1125 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_productionReferenceList1129 = new BitSet(new long[]{0x0000040000000002L});
    public static final BitSet FOLLOW_45_in_constructorProduction1172 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_constructorProduction1182 = new BitSet(new long[]{0x0000001100000000L});
    public static final BitSet FOLLOW_36_in_constructorProduction1201 = new BitSet(new long[]{0x0000100000000000L});
    public static final BitSet FOLLOW_44_in_constructorProduction1203 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_constructorProduction1205 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_constructorProduction1215 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_constructorProduction1228 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_constructorProduction1237 = new BitSet(new long[]{0x007F4102000000E0L});
    public static final BitSet FOLLOW_factorList_in_constructorProduction1247 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_constructorProduction1260 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_productionFactor_in_factorList1303 = new BitSet(new long[]{0x007F4100000000E2L});
    public static final BitSet FOLLOW_terminal_in_productionFactor1340 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_attribute_in_productionFactor1352 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_optionalAttributeList_in_productionFactor1364 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_46_in_optionalAttributeList1393 = new BitSet(new long[]{0x007FC100000000E0L});
    public static final BitSet FOLLOW_factorList_in_optionalAttributeList1403 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_optionalAttributeList1416 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_deepAttribute1459 = new BitSet(new long[]{0x0000000100000002L});
    public static final BitSet FOLLOW_32_in_deepAttribute1478 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_deepAttribute1488 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_intLiteralAttribute_in_flatAttribute1535 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_doubleLiteralAttribute_in_flatAttribute1547 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_charLiteralAttribute_in_flatAttribute1559 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_booleanLiteralAttribute_in_flatAttribute1571 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_stringLiteralAttribute_in_flatAttribute1583 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_identifierAttribute_in_flatAttribute1595 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_referenceAttribute_in_flatAttribute1607 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_multiLineStringAttribute_in_flatAttribute1619 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_48_in_charLiteralAttribute1648 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_charLiteralAttribute1650 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_charLiteralAttribute1660 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_49_in_stringLiteralAttribute1706 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_stringLiteralAttribute1708 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_stringLiteralAttribute1718 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_50_in_multiLineStringAttribute1764 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_multiLineStringAttribute1766 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_multiLineStringAttribute1776 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_51_in_intLiteralAttribute1822 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_intLiteralAttribute1824 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_intLiteralAttribute1834 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_52_in_identifierAttribute1880 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_identifierAttribute1882 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_identifierAttribute1892 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_53_in_doubleLiteralAttribute1938 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_doubleLiteralAttribute1940 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_doubleLiteralAttribute1950 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_54_in_booleanLiteralAttribute1996 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_booleanLiteralAttribute1998 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_booleanLiteralAttribute2008 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_40_in_referenceAttribute2054 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_referenceAttribute2056 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_referenceAttribute2066 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_referenceAttribute2079 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_IDENT_in_referenceAttribute2089 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_deepAttribute_in_attribute2129 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_flatAttribute_in_attribute2141 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_CHAR_LITERAL_in_charToken2177 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_keyword2230 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_charToken_in_terminal2270 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_keyword_in_terminal2282 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TRUE_in_booleanLiteral2303 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FALSE_in_booleanLiteral2315 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_constant0 = new BitSet(new long[]{0x0000000000000002L});

}